<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 可遍历的结构 通过 ...包上方括号，转换为数组
        let map1 = new Map();
        map1.set(true, 'zhen');
        map1.set({name: 'Tina'}, '通过map添加的数据');
        map1.set('age', '18');
        console.log(map1);
        let arr1 = [...map1]; // map转换为数组
        console.log(arr1);
        let set1 = new Set([1,2,3,'AAA', true, 3]); // 数组转换为set
        console.log(set1);
        let arr2 = [...set1]; // set转换为数组
        console.log(arr2);
        let arrTem = [1,2,'a', false, 2, 4];
        let map2 = new Map([arrTem, [false, 'f23r4t'], [{age: 18}, 'hello']]); // 数组转换为map
        // {age: 18} 这个对象作为key，‘hello’是value
        console.log(map2);
    </script>
</body>
</html>